﻿using lot.SDK;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace lot
{
    /// <summary>
    /// LotSettingForm.xaml 的交互逻辑
    /// </summary>
    public partial class LotSettingForm : UserControl
    {
        public delegate void ConfigAction(lotConfigs config,double time);
        public event ConfigAction configaction;
        public LotSettingForm()
        {
            InitializeComponent();
        }

        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {

        }

        private void configformSave_click(object sender, RoutedEventArgs e)
        {
            lotConfigs lotConfigs = new lotConfigs();
            lotConfigs.deviceid = deviceid.Text;
            lotConfigs.appid = TextBox_appid.Text;
            lotConfigs.appkey = TextBox_appkey.Text;
            lotConfigs.ip = TextBox_IP.Text;
            lotConfigs.port = TextBox_IPPORT.Text;
            lotConfigs.certpwd = TextBox_password.Text;
            configaction?.Invoke(lotConfigs,timeslider.Value);
        }
    }
}
